'use strict'
import Vue from 'vue'
let mutations = {}
mutations.SetPageType = function (state, pageType) {
  state.pageType = pageType
}
mutations.setView1stMounted = function (state, pageType) {
  state.view1stMounted = pageType
}

mutations.initDataSscCachePaymentInfo = function (state, paramObj) {
  state.ssc.cache.paymentInfo = {
    internalOrderCode: '',
    internalOrderName: '',
    budgetSubjectCode: '',
    budgetSubjectName: '',
    notincludetaxessum: 0,
    taxrate: 0,
    reimbursesum: 0,
    actualreimbursesum: 0,
    summary: ''
  }
}
mutations.setLdapTree = function (state, paramObj) {
  state.ldap.departmentData = paramObj
}
mutations.setLdapArray = function (state, paramObj) {
  state.ldap.departmentArray = paramObj
}
mutations.setUserArray = function (state, paramObj) {
  state.ldap.userArray = paramObj
}
mutations.updateDataSscCachePaymentInfo = function (state, paramObj) {
  state.ssc.cache.paymentInfo[paramObj.name] = paramObj.value
}
mutations.updateDataSscReimburse = function (state, paramObj) {
  state.ssc.reimburse[paramObj.name] = paramObj.value
}
mutations.updateDataSscReimburseWhBtReimburse = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburse[paramObj.name] = paramObj.value
}
mutations.updateSelectRowSscReimburseWhBtReimburseCostshare = function (state, paramObj) {
  state.gridSelectRow.ssc.reimburse.whBtReimburseCostshare[paramObj.name] = paramObj.value
}
mutations.updateSelectRowSscReimburseWhBtReimburseDdSub = function (state, paramObj) {
  state.gridSelectRow.ssc.reimburse.whBtReimburseDdSub[paramObj.name] = paramObj.value
}
mutations.updateSelectRowSscReimburseWhBtReimburseRcmDetail = function (state, paramObj) {
  state.gridSelectRow.ssc.reimburse.whBtReimburseRcmDetail[paramObj.name] = paramObj.value
}
mutations.SetDataSscReimburseStaffBankList = function (state, paramObj) {
  state.ssc.reimburse.staffBankList = paramObj
  if (paramObj.length >= 1) {
    state.ssc.reimburse.accountbanknumber = paramObj[0]['employeeBankNo']
  }
}
mutations.SetDataSscReimburseWhBtReimburse = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburse = paramObj
}
mutations.SetDataSscReimburseWhBtReimburseDdSub = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburseDdSub = paramObj
  for (let i in paramObj) {
    if (paramObj[i].subjectcode === '500307000901' || paramObj[i].subjectcode === '500307000101') {
      state.chailvRow.ssc.reimburse.whBtReimburseDdSub = paramObj[i]
      break
    }
  }
}
mutations.upGridPageInfoWithPathAndValue = function (state, paramObj) {
  if (paramObj.name !== 'max' && paramObj.name !== 'count' && paramObj.name !== 'start') {
    return
  }
  state.gridPageInfo.ssc.reimburse[paramObj.path][paramObj.name] = paramObj.value
  if (paramObj.name === 'count' || paramObj.name === 'max') {
    state.gridPageInfo.ssc.reimburse[paramObj.path]['start'] = 0
  }
}
mutations.SetDataSscReimburseWhBtReimburseCostshare = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburseCostshare = paramObj
}
mutations.SetDataSscReimburseWhBtTravelSubsidyDetails = function (state, paramObj) {
  state.ssc.reimburse.whBtTravelSubsidyDetails = paramObj
}
mutations.SetDataSscReimburseWhBtTransportationDetails = function (state, paramObj) {
  state.ssc.reimburse.whBtTransportationDetails = paramObj
}
mutations.SetDataSscReimburseWhBtFareDetails = function (state, paramObj) {
  state.ssc.reimburse.whBtFareDetails = paramObj
}
mutations.SetDataSscReimburseWhBtStayDetails = function (state, paramObj) {
  state.ssc.reimburse.whBtStayDetails = paramObj
}
mutations.SetDataSscReimburseWhBtReimburseRcmDetails = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburseRcmDetail = paramObj
}
mutations.SetDataSscReimburseCtCrossCompany = function (state, paramObj) {
  state.ssc.reimburse.crossCompanyInfo = paramObj
}
mutations.SetDataSscReimburseBBOptions = function (state, paramObj) {
  state.ssc.reimburse.bbOptions = paramObj
}
mutations.updateDataSscReimburseWhBtReimburseRcmSub = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburseRcmSub[paramObj.name] = paramObj.value
}
mutations.SetDataSscReimburseWhBtReimburseRcmSub = function (state, paramObj) {
  state.ssc.reimburse.whBtReimburseRcmSub = paramObj
}
mutations.SetDataSscReimburseCostCenterList = function (state, paramObj) {
  state.ssc.reimburse.costCenterList = paramObj
}
mutations.SetDataSscReimburseInternalOrderList = function (state, paramObj) {
  state.ssc.reimburse.internalOrderList = paramObj
}
mutations.SetDataSscReimburseBudgetSubjectList = function (state, paramObj) {
  state.ssc.reimburse.budgetSubjectList = paramObj
}
mutations.SetGridSelectMid = function (state, paramObj) {
  state.mid = paramObj
}
mutations.SetGridCheckboxMids = function (state, paramObj) {
  state.gridCheckboxMids = paramObj
}
mutations.setCostCenter = function (state, costCenter) {
  state.costCenter = costCenter
}
// mutations.draftSubmitService = function (state, paramObj) {
//   state.paramObj = paramObj
// }

mutations.SetDataSscReimburseAmountSum = function (state, paramObj) {
  state.amountSum = paramObj
}
mutations.SetDataSscReimburseCheckResult = function (state, paramObj) {
  state.checkResult = paramObj
}
mutations.SetDataSscReimbursebxmxMid = function (state, paramObj) {
  state.bxmxMid = paramObj
}
mutations.SetDataSscReimburseApproveFeeUpdateResult = function (state, paramObj) {
  state.approveFeeUpdateResult = paramObj
}
mutations.SetDataSscReimburseRetMsg = function (state, paramObj) {
  state.retMsg = paramObj // 存放方法调用时的返回值，如果异常，则提示出来。
}
mutations.SetDataSscReimburseCertNo = function (state, paramObj) {
  state.certNo = paramObj
}
mutations.SetDataSscReimburseSplitInternalOrderList = function (state, paramObj) {
  Vue.set(state.ssc.reimburse, 'splitInternalOrderList', paramObj)
}
export default mutations
